package nl.rainbowsheep.reisorg.cust.site.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import javax.validation.Valid;
import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

//@JsonIgnoreProperties(ignoreUnknown = true)
public class Customer implements Serializable {

    private Long id;

    @NotEmpty
    private String gender;

    @NotEmpty
    @Pattern(regexp = "^[A-Za-z\\s.]+$")
    private String surname;

    @NotEmpty
    @Pattern(regexp = "^[A-Za-z\\s.]+$")
    private String lastname;

    @NotNull
    @Past
    @DateTimeFormat(pattern = "dd-MM-yyyy")
    private Date birthdate;

    private Date registrationDate;

    //TODO: nog diakrieten toevoegen
    @NotEmpty
    //@Pattern(regexp = "^[\\p{L}.-]+$")
    @Pattern(regexp = "^[A-Za-z\\s.-]+$")
    private String streetAddress;

    @NotEmpty
    private String houseNumber;

    private String extraAddress;

    @NotEmpty
    @Pattern(regexp = "^[0-9]{4}\\s*[a-zA-Z]{2}$")
    private String postalCode;

    @NotEmpty
    private String city;

    @NotEmpty
    @Pattern(regexp = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")
    private String email;

    private String telephone1;
    private String telephone2;

    @Valid
    private long burritoUserId;
    private Set<TravelGroup> travelgroups;

    public Customer() {
    }

    public Set<TravelGroup> getTravelgroups() {
        return travelgroups;
    }

    public void setTravelgroups(Set<TravelGroup> travelgroups) {
        this.travelgroups = travelgroups;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public Date getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Date birthdate) {
        this.birthdate = birthdate;
    }

    public String getStreetAddress() {
        return streetAddress;
    }

    public void setStreetAddress(String streetAddress) {
        this.streetAddress = streetAddress;
    }

    public String getHouseNumber() {
        return houseNumber;
    }

    public void setHouseNumber(String houseNumber) {
        this.houseNumber = houseNumber;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelephone1() {
        return telephone1;
    }

    public void setTelephone1(String telephone1) {
        this.telephone1 = telephone1;
    }

    public String getTelephone2() {
        return telephone2;
    }

    public void setTelephone2(String telephone2) {
        this.telephone2 = telephone2;
    }

    public long getBurritoUserId() {
        return burritoUserId;
    }

    public void setBurritoUserId(long burritoUserId) {
        this.burritoUserId = burritoUserId;
    }

    public Date getRegistrationDate() {
        return registrationDate;
    }

    public void setRegistrationDate(Date registrationDate) {
        this.registrationDate = registrationDate;
    }

    public String getExtraAddress() {
        return extraAddress;
    }

    public void setExtraAddress(String extraAddress) {
        this.extraAddress = extraAddress;
    }

}
